home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacWindows.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  36.5 KB  |  1,115 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacWindows.a
  3. ;
  4. ;    Contains:    Window Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  19. __MACWINDOWS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  25.     include 'Aliases.a'
  26.     ENDIF
  27.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  28.     include 'AppleEvents.a'
  29.     ENDIF
  30.     IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
  31.     include 'Collections.a'
  32.     ENDIF
  33.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  34.     include 'Drag.a'
  35.     ENDIF
  36.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  37.     include 'Events.a'
  38.     ENDIF
  39.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  40.     include 'Menus.a'
  41.     ENDIF
  42.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  43.     include 'MixedMode.a'
  44.     ENDIF
  45.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  46.     include 'QDOffscreen.a'
  47.     ENDIF
  48.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  49.     include 'Quickdraw.a'
  50.     ENDIF
  51.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  52.     include 'TextCommon.a'
  53.     ENDIF
  54.  
  55. ; ——————————————————————————————————————————————————————————————————————————————————————
  56. ;  • Window Definition Type                                                                
  57. ; ——————————————————————————————————————————————————————————————————————————————————————
  58.  
  59. kWindowDefProcType                EQU        'WDEF'
  60. ; ——————————————————————————————————————————————————————————————————————————————————————
  61. ;  • System 7.5 Window Definition Resource IDs                                            
  62. ; ——————————————————————————————————————————————————————————————————————————————————————
  63.  
  64. kStandardWindowDefinition        EQU        0                    ; for document windows and dialogs
  65. kRoundWindowDefinition            EQU        1                    ; old da-style window
  66. kFloatingWindowDefinition        EQU        124                    ; for floating windows
  67. ; ——————————————————————————————————————————————————————————————————————————————————————
  68. ;  • Variant Codes                                                                        
  69. ; ——————————————————————————————————————————————————————————————————————————————————————
  70.  
  71.                                                             ; for use with kStandardWindowDefinition 
  72. kDocumentWindowVariantCode        EQU        0
  73. kModalDialogVariantCode            EQU        1
  74. kPlainDialogVariantCode            EQU        2
  75. kShadowDialogVariantCode        EQU        3
  76. kMovableModalDialogVariantCode    EQU        5
  77. kAlertVariantCode                EQU        7
  78. kMovableAlertVariantCode        EQU        9                    ; for use with kFloatingWindowDefinition 
  79. kSideFloaterVariantCode            EQU        8
  80.  
  81. ; ——————————————————————————————————————————————————————————————————————————————————————
  82. ;  • DefProc IDs                                                                        
  83. ; ——————————————————————————————————————————————————————————————————————————————————————
  84.  
  85.                                                             ; classic ids 
  86. documentProc                    EQU        0
  87. dBoxProc                        EQU        1
  88. plainDBox                        EQU        2
  89. altDBoxProc                        EQU        3
  90. noGrowDocProc                    EQU        4
  91. movableDBoxProc                    EQU        5
  92. zoomDocProc                        EQU        8
  93. zoomNoGrow                        EQU        12
  94. rDocProc                        EQU        16                    ; floating window defproc ids 
  95. floatProc                        EQU        1985
  96. floatGrowProc                    EQU        1987
  97. floatZoomProc                    EQU        1989
  98. floatZoomGrowProc                EQU        1991
  99. floatSideProc                    EQU        1993
  100. floatSideGrowProc                EQU        1995
  101. floatSideZoomProc                EQU        1997
  102. floatSideZoomGrowProc            EQU        1999
  103.  
  104.                                                             ; Resource IDs for theme-savvy window defprocs 
  105. kWindowDocumentDefProcResID        EQU        64
  106. kWindowDialogDefProcResID        EQU        65
  107. kWindowUtilityDefProcResID        EQU        66
  108. kWindowUtilitySideTitleDefProcResID EQU    67
  109.  
  110.                                                             ; Proc IDs for theme-savvy windows 
  111. kWindowDocumentProc                EQU        1024
  112. kWindowGrowDocumentProc            EQU        1025
  113. kWindowVertZoomDocumentProc        EQU        1026
  114. kWindowVertZoomGrowDocumentProc    EQU        1027
  115. kWindowHorizZoomDocumentProc    EQU        1028
  116. kWindowHorizZoomGrowDocumentProc EQU    1029
  117. kWindowFullZoomDocumentProc        EQU        1030
  118. kWindowFullZoomGrowDocumentProc    EQU        1031
  119.  
  120.                                                             ; Proc IDs for theme-savvy dialogs 
  121. kWindowPlainDialogProc            EQU        1040
  122. kWindowShadowDialogProc            EQU        1041
  123. kWindowModalDialogProc            EQU        1042
  124. kWindowMovableModalDialogProc    EQU        1043
  125. kWindowAlertProc                EQU        1044
  126. kWindowMovableAlertProc            EQU        1045
  127. ;  procIDs available in Appearance 1.0.1 or later 
  128.  
  129. kWindowMovableModalGrowProc        EQU        1046
  130.  
  131.                                                             ; Proc IDs for top title bar theme-savvy floating windows 
  132. kWindowFloatProc                EQU        1057
  133. kWindowFloatGrowProc            EQU        1059
  134. kWindowFloatVertZoomProc        EQU        1061
  135. kWindowFloatVertZoomGrowProc    EQU        1063
  136. kWindowFloatHorizZoomProc        EQU        1065
  137. kWindowFloatHorizZoomGrowProc    EQU        1067
  138. kWindowFloatFullZoomProc        EQU        1069
  139. kWindowFloatFullZoomGrowProc    EQU        1071
  140.  
  141.  
  142.                                                             ; Proc IDs for side title bar theme-savvy floating windows 
  143. kWindowFloatSideProc            EQU        1073
  144. kWindowFloatSideGrowProc        EQU        1075
  145. kWindowFloatSideVertZoomProc    EQU        1077
  146. kWindowFloatSideVertZoomGrowProc EQU    1079
  147. kWindowFloatSideHorizZoomProc    EQU        1081
  148. kWindowFloatSideHorizZoomGrowProc EQU    1083
  149. kWindowFloatSideFullZoomProc    EQU        1085
  150. kWindowFloatSideFullZoomGrowProc EQU    1087
  151. ; ——————————————————————————————————————————————————————————————————————————————————————
  152. ;  • System 7 Window Positioning Constants                                                
  153. ;                                                                                         
  154. ;  Passed into StandardAlert and used in ‘WIND’, ‘DLOG’, and ‘ALRT’ templates            
  155. ;  StandardAlert uses zero to specify the default position. Other calls use zero to        
  156. ;  specify “no position”.  Do not pass these constants to RepositionWindow.  Do not        
  157. ;  store these constants in the BasicWindowDescription of a ‘wind’ resource.            
  158. ; ——————————————————————————————————————————————————————————————————————————————————————
  159.  
  160.  
  161. kWindowNoPosition                EQU        $0000
  162. kWindowDefaultPosition            EQU        $0000
  163. kWindowCenterMainScreen            EQU        $280A
  164. kWindowAlertPositionMainScreen    EQU        $300A
  165. kWindowStaggerMainScreen        EQU        $380A
  166. kWindowCenterParentWindow        EQU        $A80A
  167. kWindowAlertPositionParentWindow EQU    $B00A
  168. kWindowStaggerParentWindow        EQU        $B80A
  169. kWindowCenterParentWindowScreen    EQU        $680A
  170. kWindowAlertPositionParentWindowScreen EQU $700A
  171. kWindowStaggerParentWindowScreen EQU    $780A
  172. ; ——————————————————————————————————————————————————————————————————————————————————————
  173. ;  • GetWindowRegion Types                                                                
  174. ; ——————————————————————————————————————————————————————————————————————————————————————
  175.  
  176.  
  177.                                                             ; Region values to pass into GetWindowRegion 
  178. kWindowTitleBarRgn                EQU        0
  179. kWindowTitleTextRgn                EQU        1
  180. kWindowCloseBoxRgn                EQU        2
  181. kWindowZoomBoxRgn                EQU        3
  182. kWindowDragRgn                    EQU        5
  183. kWindowGrowRgn                    EQU        6
  184. kWindowCollapseBoxRgn            EQU        7
  185. kWindowStructureRgn                EQU        32
  186. kWindowContentRgn                EQU        33
  187. ; typedef UInt16                         WindowRegionCode
  188.  
  189. ;  GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion 
  190. GetWindowRegionRec        RECORD 0
  191. winRgn                     ds.l    1                ; offset: $0 (0)
  192. regionCode                 ds.w    1                ; offset: $4 (4)
  193. sizeof                     EQU *                    ; size:   $6 (6)
  194.                         ENDR
  195. ; typedef struct GetWindowRegionRec *    GetWindowRegionPtr
  196.  
  197.  
  198. ; ——————————————————————————————————————————————————————————————————————————————————————
  199. ;  • Standard Window Kinds                                                                
  200. ; ——————————————————————————————————————————————————————————————————————————————————————
  201.  
  202. dialogKind                        EQU        2
  203. userKind                        EQU        8
  204. kDialogWindowKind                EQU        2
  205. kApplicationWindowKind            EQU        8
  206.  
  207. ; ——————————————————————————————————————————————————————————————————————————————————————
  208. ;  • FindWindow Result Codes                                                            
  209. ; ——————————————————————————————————————————————————————————————————————————————————————
  210.  
  211. inDesk                            EQU        0
  212. inNoWindow                        EQU        0
  213. inMenuBar                        EQU        1
  214. inSysWindow                        EQU        2
  215. inContent                        EQU        3
  216. inDrag                            EQU        4
  217. inGrow                            EQU        5
  218. inGoAway                        EQU        6
  219. inZoomIn                        EQU        7
  220. inZoomOut                        EQU        8
  221. inCollapseBox                    EQU        11
  222. ; ——————————————————————————————————————————————————————————————————————————————————————
  223. ;  • Window Definition Hit Test Result Codes                                            
  224. ; ——————————————————————————————————————————————————————————————————————————————————————
  225.  
  226. wNoHit                            EQU        0
  227. wInContent                        EQU        1
  228. wInDrag                            EQU        2
  229. wInGrow                            EQU        3
  230. wInGoAway                        EQU        4
  231. wInZoomIn                        EQU        5
  232. wInZoomOut                        EQU        6
  233. wInCollapseBox                    EQU        9
  234. ; ——————————————————————————————————————————————————————————————————————————————————————
  235. ;  • Window Definition Messages                                                            
  236. ; ——————————————————————————————————————————————————————————————————————————————————————
  237.  
  238.  
  239. kWindowMsgDraw                    EQU        0
  240. kWindowMsgHitTest                EQU        1
  241. kWindowMsgCalculateShape        EQU        2
  242. kWindowMsgInitialize            EQU        3
  243. kWindowMsgCleanUp                EQU        4
  244. kWindowMsgDrawGrowOutline        EQU        5
  245. kWindowMsgDrawGrowBox            EQU        6
  246. kWindowMsgGetFeatures            EQU        7
  247. kWindowMsgGetRegion                EQU        8                    ; old names
  248. wDraw                            EQU        0
  249. wHit                            EQU        1
  250. wCalcRgns                        EQU        2
  251. wNew                            EQU        3
  252. wDispose                        EQU        4
  253. wGrow                            EQU        5
  254. wDrawGIcon                        EQU        6
  255.  
  256. ; ——————————————————————————————————————————————————————————————————————————————————————
  257. ;  • Window Feature Bits                                                                
  258. ; ——————————————————————————————————————————————————————————————————————————————————————
  259.  
  260. kWindowCanGrow                    EQU        $01
  261. kWindowCanZoom                    EQU        $02
  262. kWindowCanCollapse                EQU        $04
  263. kWindowIsModal                    EQU        $08
  264. kWindowCanGetWindowRegion        EQU        $10
  265. kWindowIsAlert                    EQU        $20
  266. kWindowHasTitleBar                EQU        $40
  267.  
  268. ; ——————————————————————————————————————————————————————————————————————————————————————
  269. ;  • Desktop Pattern Resource ID                                                        
  270. ; ——————————————————————————————————————————————————————————————————————————————————————
  271.  
  272. deskPatID                        EQU        16
  273.  
  274.  
  275. ; ——————————————————————————————————————————————————————————————————————————————————————
  276. ;  • Window Color Part Codes                                                            
  277. ; ——————————————————————————————————————————————————————————————————————————————————————
  278.  
  279. wContentColor                    EQU        0
  280. wFrameColor                        EQU        1
  281. wTextColor                        EQU        2
  282. wHiliteColor                    EQU        3
  283. wTitleBarColor                    EQU        4
  284.  
  285. ; ——————————————————————————————————————————————————————————————————————————————————————
  286. ;     • Region Dragging Constants
  287. ;/*——————————————————————————————————————————————————————————————————————————————————————
  288.  
  289.  
  290. kMouseUpOutOfSlop                EQU        $80008000
  291.  
  292. ; ——————————————————————————————————————————————————————————————————————————————————————
  293. ;  • Window Color Table                                                                    
  294. ; ——————————————————————————————————————————————————————————————————————————————————————
  295. WinCTab                    RECORD 0
  296. wCSeed                     ds.l    1                ; offset: $0 (0)        ;  reserved 
  297. wCReserved                 ds.w    1                ; offset: $4 (4)        ;  reserved 
  298. ctSize                     ds.w    1                ; offset: $6 (6)        ;  usually 4 for windows 
  299. ctTable                     ds.b    5 * ColorSpec.sizeof ; offset: $8 (8)
  300. sizeof                     EQU *                    ; size:   $30 (48)
  301.                         ENDR
  302. ; typedef struct WinCTab *                WCTabPtr
  303.  
  304. ; typedef WCTabPtr *                    WCTabHandle
  305.  
  306. ; ——————————————————————————————————————————————————————————————————————————————————————
  307. ;  • WindowRecord                                                                        
  308. ; ——————————————————————————————————————————————————————————————————————————————————————
  309.  
  310.  
  311. ; typedef WindowRecord *                WindowPeek
  312.  
  313. WindowRecord            RECORD 0
  314. port                     ds        GrafPort        ; offset: $0 (0)
  315. windowKind                 ds.w    1                ; offset: $6C (108)
  316. visible                     ds.b    1                ; offset: $6E (110)
  317. hilited                     ds.b    1                ; offset: $6F (111)
  318. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  319. spareFlag                 ds.b    1                ; offset: $71 (113)
  320. strucRgn                 ds.l    1                ; offset: $72 (114)
  321. contRgn                     ds.l    1                ; offset: $76 (118)
  322. updateRgn                 ds.l    1                ; offset: $7A (122)
  323. windowDefProc             ds.l    1                ; offset: $7E (126)
  324. dataHandle                 ds.l    1                ; offset: $82 (130)
  325. titleHandle                 ds.l    1                ; offset: $86 (134)
  326. titleWidth                 ds.w    1                ; offset: $8A (138)
  327. controlList                 ds.l    1                ; offset: $8C (140)
  328. nextWindow                 ds.l    1                ; offset: $90 (144)
  329. windowPic                 ds.l    1                ; offset: $94 (148)
  330. refCon                     ds.l    1                ; offset: $98 (152)
  331. sizeof                     EQU *                    ; size:   $9C (156)
  332.                         ENDR
  333. ; ——————————————————————————————————————————————————————————————————————————————————————
  334. ;  • Color WindowRecord                                                                    
  335. ; ——————————————————————————————————————————————————————————————————————————————————————
  336.  
  337.  
  338. ; typedef CWindowRecord *                CWindowPeek
  339.  
  340. CWindowRecord            RECORD 0
  341. port                     ds        CGrafPort        ; offset: $0 (0)
  342. windowKind                 ds.w    1                ; offset: $6C (108)
  343. visible                     ds.b    1                ; offset: $6E (110)
  344. hilited                     ds.b    1                ; offset: $6F (111)
  345. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  346. spareFlag                 ds.b    1                ; offset: $71 (113)
  347. strucRgn                 ds.l    1                ; offset: $72 (114)
  348. contRgn                     ds.l    1                ; offset: $76 (118)
  349. updateRgn                 ds.l    1                ; offset: $7A (122)
  350. windowDefProc             ds.l    1                ; offset: $7E (126)
  351. dataHandle                 ds.l    1                ; offset: $82 (130)
  352. titleHandle                 ds.l    1                ; offset: $86 (134)
  353. titleWidth                 ds.w    1                ; offset: $8A (138)
  354. controlList                 ds.l    1                ; offset: $8C (140)
  355. nextWindow                 ds.l    1                ; offset: $90 (144)
  356. windowPic                 ds.l    1                ; offset: $94 (148)
  357. refCon                     ds.l    1                ; offset: $98 (152)
  358. sizeof                     EQU *                    ; size:   $9C (156)
  359.                         ENDR
  360. ; ——————————————————————————————————————————————————————————————————————————————————————
  361. ;  • AuxWinHandle                                                                        
  362. ; ——————————————————————————————————————————————————————————————————————————————————————
  363.  
  364.  
  365. ; typedef AuxWinRec *                    AuxWinPtr
  366.  
  367. ; typedef AuxWinPtr *                    AuxWinHandle
  368.  
  369. AuxWinRec                RECORD 0
  370. awNext                     ds.l    1                ; offset: $0 (0)        ; handle to next AuxWinRec
  371. awOwner                     ds.l    1                ; offset: $4 (4)        ; ptr to window 
  372. awCTable                 ds.l    1                ; offset: $8 (8)        ; color table for this window
  373. reserved                 ds.l    1                ; offset: $C (12)
  374. awFlags                     ds.l    1                ; offset: $10 (16)        ; reserved for expansion
  375. awReserved                 ds.l    1                ; offset: $14 (20)        ; reserved for expansion
  376. awRefCon                 ds.l    1                ; offset: $18 (24)        ; user Constant
  377. sizeof                     EQU *                    ; size:   $1C (28)
  378.                         ENDR
  379. ; ——————————————————————————————————————————————————————————————————————————————————————
  380. ;  • Window Class Ordering                                                                
  381. ;                                                                                         
  382. ;     Special cases for the “behind” parameter in window creation calls.                    
  383. ; ——————————————————————————————————————————————————————————————————————————————————————
  384.     IF &TYPE('__cplusplus') = 'UNDEFINED' THEN
  385.  
  386. kFirstWindowOfClass                EQU        -1
  387. kLastWindowOfClass                EQU        0
  388.     ELSE
  389.     ENDIF
  390. ; ——————————————————————————————————————————————————————————————————————————————————————
  391. ;  • Zoom Information Handle                                                             
  392. ; ——————————————————————————————————————————————————————————————————————————————————————
  393. WStateData                RECORD 0
  394. userState                 ds        Rect            ; offset: $0 (0)        ; user zoom state
  395. stdState                 ds        Rect            ; offset: $8 (8)        ; standard zoom state
  396. sizeof                     EQU *                    ; size:   $10 (16)
  397.                         ENDR
  398. ; typedef struct WStateData *            WStateDataPtr
  399.  
  400. ; typedef WStateDataPtr *                WStateDataHandle
  401.  
  402. ; ——————————————————————————————————————————————————————————————————————————————————————
  403. ;  • Window Creation & Persistence                                                        
  404. ; ——————————————————————————————————————————————————————————————————————————————————————
  405.  
  406. ;
  407. ; pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind)
  408. ;
  409.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  410.         _GetNewCWindow:    OPWORD    $AA46
  411.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  412.         IMPORT_CFM_FUNCTION GetNewCWindow
  413.     ENDIF
  414.  
  415. ;
  416. ; pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  419.         _NewWindow:    OPWORD    $A913
  420.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION NewWindow
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind)
  426. ;
  427.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  428.         _GetNewWindow:    OPWORD    $A9BD
  429.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION GetNewWindow
  431.     ENDIF
  432.  
  433. ;
  434. ; pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon)
  435. ;
  436.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  437.         _NewCWindow:    OPWORD    $AA45
  438.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  439.         IMPORT_CFM_FUNCTION NewCWindow
  440.     ENDIF
  441.  
  442. ;
  443. ; pascal void DisposeWindow(WindowPtr theWindow)
  444. ;
  445.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  446.         _DisposeWindow:    OPWORD    $A914
  447.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  448.         IMPORT_CFM_FUNCTION DisposeWindow
  449.     ENDIF
  450.  
  451. ;
  452. ; pascal void CloseWindow(WindowPtr theWindow)
  453. ;
  454.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  455.         _CloseWindow:    OPWORD    $A92D
  456.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  457.         IMPORT_CFM_FUNCTION CloseWindow
  458.     ENDIF
  459.  
  460.  
  461.  
  462.  
  463. ; ——————————————————————————————————————————————————————————————————————————————————————
  464. ;  • Background Imaging                                                                    
  465. ; ——————————————————————————————————————————————————————————————————————————————————————
  466. ;
  467. ; pascal void SetWinColor(WindowPtr theWindow, WCTabHandle newColorTable)
  468. ;
  469.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  470.         _SetWinColor:    OPWORD    $AA41
  471.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  472.         IMPORT_CFM_FUNCTION SetWinColor
  473.     ENDIF
  474.  
  475. ;
  476. ; pascal void SetDeskCPat(PixPatHandle deskPixPat)
  477. ;
  478.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  479.         _SetDeskCPat:    OPWORD    $AA47
  480.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  481.         IMPORT_CFM_FUNCTION SetDeskCPat
  482.     ENDIF
  483.  
  484.  
  485.  
  486.  
  487. ; ——————————————————————————————————————————————————————————————————————————————————————
  488. ;  • Low-Level Region & Painting Routines                                                
  489. ; ——————————————————————————————————————————————————————————————————————————————————————
  490. ;
  491. ; pascal void ClipAbove(WindowPtr window)
  492. ;
  493.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  494.         _ClipAbove:    OPWORD    $A90B
  495.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  496.         IMPORT_CFM_FUNCTION ClipAbove
  497.     ENDIF
  498.  
  499. ;
  500. ; pascal void SaveOld(WindowPtr window)
  501. ;
  502.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  503.         _SaveOld:    OPWORD    $A90E
  504.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  505.         IMPORT_CFM_FUNCTION SaveOld
  506.     ENDIF
  507.  
  508. ;
  509. ; pascal void DrawNew(WindowPtr window, Boolean update)
  510. ;
  511.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  512.         _DrawNew:    OPWORD    $A90F
  513.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  514.         IMPORT_CFM_FUNCTION DrawNew
  515.     ENDIF
  516.  
  517. ;
  518. ; pascal void PaintOne(WindowPtr window, RgnHandle clobberedRgn)
  519. ;
  520.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  521.         _PaintOne:    OPWORD    $A90C
  522.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  523.         IMPORT_CFM_FUNCTION PaintOne
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal void PaintBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  530.         _PaintBehind:    OPWORD    $A90D
  531.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  532.         IMPORT_CFM_FUNCTION PaintBehind
  533.     ENDIF
  534.  
  535. ;
  536. ; pascal void CalcVis(WindowPtr window)
  537. ;
  538.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  539.         _CalcVis:    OPWORD    $A909
  540.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  541.         IMPORT_CFM_FUNCTION CalcVis
  542.     ENDIF
  543.  
  544. ;
  545. ; pascal void CalcVisBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  546. ;
  547.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  548.         _CalcVisBehind:    OPWORD    $A90A
  549.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION CalcVisBehind
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal Boolean CheckUpdate(EventRecord *theEvent)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  557.         _CheckUpdate:    OPWORD    $A911
  558.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  559.         IMPORT_CFM_FUNCTION CheckUpdate
  560.     ENDIF
  561.  
  562. ; ——————————————————————————————————————————————————————————————————————————————————————
  563. ;  • Window List                                                                        
  564. ; ——————————————————————————————————————————————————————————————————————————————————————
  565. ;
  566. ; pascal short FindWindow(Point thePoint, WindowPtr *theWindow)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  569.         _FindWindow:    OPWORD    $A92C
  570.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  571.         IMPORT_CFM_FUNCTION FindWindow
  572.     ENDIF
  573.  
  574. ;
  575. ; pascal WindowPtr FrontWindow(void )
  576. ;
  577.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  578.         _FrontWindow:    OPWORD    $A924
  579.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  580.         IMPORT_CFM_FUNCTION FrontWindow
  581.     ENDIF
  582.  
  583. ;
  584. ; pascal void BringToFront(WindowPtr theWindow)
  585. ;
  586.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  587.         _BringToFront:    OPWORD    $A920
  588.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION BringToFront
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal void SendBehind(WindowPtr theWindow, WindowPtr behindWindow)
  594. ;
  595.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  596.         _SendBehind:    OPWORD    $A921
  597.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION SendBehind
  599.     ENDIF
  600.  
  601. ;
  602. ; pascal void SelectWindow(WindowPtr theWindow)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  605.         _SelectWindow:    OPWORD    $A91F
  606.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION SelectWindow
  608.     ENDIF
  609.  
  610.  
  611. ; ——————————————————————————————————————————————————————————————————————————————————————
  612. ;  • Misc Low-Level stuff                                                                            
  613. ; ——————————————————————————————————————————————————————————————————————————————————————
  614. ;
  615. ; pascal void InitWindows(void )
  616. ;
  617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  618.         _InitWindows:    OPWORD    $A912
  619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  620.         IMPORT_CFM_FUNCTION InitWindows
  621.     ENDIF
  622.  
  623. ;
  624. ; pascal void GetWMgrPort(GrafPtr *wPort)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  627.         _GetWMgrPort:    OPWORD    $A910
  628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  629.         IMPORT_CFM_FUNCTION GetWMgrPort
  630.     ENDIF
  631.  
  632. ;
  633. ; pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  634. ;
  635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  636.         _GetCWMgrPort:    OPWORD    $AA48
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION GetCWMgrPort
  639.     ENDIF
  640.  
  641.  
  642.  
  643. ; ——————————————————————————————————————————————————————————————————————————————————————
  644. ;  • Various & Sundry Window Accessors                                                            
  645. ; ——————————————————————————————————————————————————————————————————————————————————————
  646. ;
  647. ; pascal void HiliteWindow(WindowPtr theWindow, Boolean fHilite)
  648. ;
  649.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  650.         _HiliteWindow:    OPWORD    $A91C
  651.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  652.         IMPORT_CFM_FUNCTION HiliteWindow
  653.     ENDIF
  654.  
  655. ;
  656. ; pascal OSStatus GetWindowFeatures(WindowPtr inWindow, UInt32 *outFeatures)
  657. ;
  658.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  659.         Macro
  660.         _GetWindowFeatures
  661.             move.w              #$0013,D0
  662.             dc.w                $AA74
  663.         EndM
  664.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  665.         IMPORT_CFM_FUNCTION GetWindowFeatures
  666.     ENDIF
  667.  
  668. ;
  669. ; pascal OSStatus GetWindowRegion(WindowPtr inWindow, WindowRegionCode inRegionCode, RgnHandle ioWinRgn)
  670. ;
  671.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  672.         Macro
  673.         _GetWindowRegion
  674.             move.w              #$0014,D0
  675.             dc.w                $AA74
  676.         EndM
  677.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  678.         IMPORT_CFM_FUNCTION GetWindowRegion
  679.     ENDIF
  680.  
  681. ;
  682. ; pascal void SetWRefCon(WindowPtr theWindow, long data)
  683. ;
  684.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  685.         _SetWRefCon:    OPWORD    $A918
  686.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  687.         IMPORT_CFM_FUNCTION SetWRefCon
  688.     ENDIF
  689.  
  690. ;
  691. ; pascal long GetWRefCon(WindowPtr theWindow)
  692. ;
  693.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  694.         _GetWRefCon:    OPWORD    $A917
  695.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  696.         IMPORT_CFM_FUNCTION GetWRefCon
  697.     ENDIF
  698.  
  699. ;
  700. ; pascal void SetWindowPic(WindowPtr theWindow, PicHandle pic)
  701. ;
  702.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  703.         _SetWindowPic:    OPWORD    $A92E
  704.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  705.         IMPORT_CFM_FUNCTION SetWindowPic
  706.     ENDIF
  707.  
  708. ;
  709. ; pascal PicHandle GetWindowPic(WindowPtr theWindow)
  710. ;
  711.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  712.         _GetWindowPic:    OPWORD    $A92F
  713.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  714.         IMPORT_CFM_FUNCTION GetWindowPic
  715.     ENDIF
  716.  
  717. ;
  718. ; pascal short GetWVariant(WindowPtr theWindow)
  719. ;
  720.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  721.         _GetWVariant:    OPWORD    $A80A
  722.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  723.         IMPORT_CFM_FUNCTION GetWVariant
  724.     ENDIF
  725.  
  726. ; ——————————————————————————————————————————————————————————————————————————————————————
  727. ;  • Update Events                                                                        
  728. ; ——————————————————————————————————————————————————————————————————————————————————————
  729. ;
  730. ; pascal void InvalRect(const Rect *badRect)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  733.         _InvalRect:    OPWORD    $A928
  734.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  735.         IMPORT_CFM_FUNCTION InvalRect
  736.     ENDIF
  737.  
  738. ;
  739. ; pascal void InvalRgn(RgnHandle badRgn)
  740. ;
  741.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  742.         _InvalRgn:    OPWORD    $A927
  743.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  744.         IMPORT_CFM_FUNCTION InvalRgn
  745.     ENDIF
  746.  
  747. ;
  748. ; pascal void ValidRect(const Rect *goodRect)
  749. ;
  750.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  751.         _ValidRect:    OPWORD    $A92A
  752.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  753.         IMPORT_CFM_FUNCTION ValidRect
  754.     ENDIF
  755.  
  756. ;
  757. ; pascal void ValidRgn(RgnHandle goodRgn)
  758. ;
  759.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  760.         _ValidRgn:    OPWORD    $A929
  761.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  762.         IMPORT_CFM_FUNCTION ValidRgn
  763.     ENDIF
  764.  
  765. ;
  766. ; pascal void BeginUpdate(WindowPtr theWindow)
  767. ;
  768.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  769.         _BeginUpdate:    OPWORD    $A922
  770.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  771.         IMPORT_CFM_FUNCTION BeginUpdate
  772.     ENDIF
  773.  
  774. ;
  775. ; pascal void EndUpdate(WindowPtr theWindow)
  776. ;
  777.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  778.         _EndUpdate:    OPWORD    $A923
  779.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  780.         IMPORT_CFM_FUNCTION EndUpdate
  781.     ENDIF
  782.  
  783.  
  784. ; ——————————————————————————————————————————————————————————————————————————————————————
  785. ;  • DrawGrowIcon                                                                        
  786. ;                                                                                         
  787. ;     With the advent of Appearance, DrawGrowIcon is obsolete.  From Appearance 1.0        
  788. ;     onward, the system WDEF automagically draws the grow icon for growable window        
  789. ;     procIDs.                                                                            
  790. ; ——————————————————————————————————————————————————————————————————————————————————————
  791. ;
  792. ; pascal void DrawGrowIcon(WindowPtr theWindow)
  793. ;
  794.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  795.         _DrawGrowIcon:    OPWORD    $A904
  796.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  797.         IMPORT_CFM_FUNCTION DrawGrowIcon
  798.     ENDIF
  799.  
  800.  
  801. ; ——————————————————————————————————————————————————————————————————————————————————————
  802. ;  • Window Titles & Document Support                                                    
  803. ; ——————————————————————————————————————————————————————————————————————————————————————
  804. ;
  805. ; pascal void SetWTitle(WindowPtr theWindow, ConstStr255Param title)
  806. ;
  807.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  808.         _SetWTitle:    OPWORD    $A91A
  809.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  810.         IMPORT_CFM_FUNCTION SetWTitle
  811.     ENDIF
  812.  
  813. ;
  814. ; pascal void GetWTitle(WindowPtr theWindow, Str255 title)
  815. ;
  816.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  817.         _GetWTitle:    OPWORD    $A919
  818.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  819.         IMPORT_CFM_FUNCTION GetWTitle
  820.     ENDIF
  821.  
  822.  
  823.  
  824. ; ——————————————————————————————————————————————————————————————————————————————————————
  825. ;  • Window Positioning                                                                    
  826. ; ——————————————————————————————————————————————————————————————————————————————————————
  827. ;
  828. ; pascal Boolean IsWindowCollapsable(WindowPtr inWindow)
  829. ;
  830.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  831.         Macro
  832.         _IsWindowCollapsable
  833.             move.w              #$000F,D0
  834.             dc.w                $AA74
  835.         EndM
  836.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  837.         IMPORT_CFM_FUNCTION IsWindowCollapsable
  838.     ENDIF
  839.  
  840. ;
  841. ; pascal Boolean IsWindowCollapsed(WindowPtr inWindow)
  842. ;
  843.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  844.         Macro
  845.         _IsWindowCollapsed
  846.             move.w              #$0010,D0
  847.             dc.w                $AA74
  848.         EndM
  849.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  850.         IMPORT_CFM_FUNCTION IsWindowCollapsed
  851.     ENDIF
  852.  
  853. ;
  854. ; pascal OSStatus CollapseWindow(WindowPtr inWindow, Boolean inCollapseIt)
  855. ;
  856.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  857.         Macro
  858.         _CollapseWindow
  859.             move.w              #$0011,D0
  860.             dc.w                $AA74
  861.         EndM
  862.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  863.         IMPORT_CFM_FUNCTION CollapseWindow
  864.     ENDIF
  865.  
  866. ;
  867. ; pascal OSStatus CollapseAllWindows(Boolean inCollapseEm)
  868. ;
  869.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  870.         Macro
  871.         _CollapseAllWindows
  872.             move.w              #$0012,D0
  873.             dc.w                $AA74
  874.         EndM
  875.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  876.         IMPORT_CFM_FUNCTION CollapseAllWindows
  877.     ENDIF
  878.  
  879. ;
  880. ; pascal void MoveWindow(WindowPtr theWindow, short hGlobal, short vGlobal, Boolean front)
  881. ;
  882.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  883.         _MoveWindow:    OPWORD    $A91B
  884.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  885.         IMPORT_CFM_FUNCTION MoveWindow
  886.     ENDIF
  887.  
  888. ;
  889. ; pascal void SizeWindow(WindowPtr theWindow, short w, short h, Boolean fUpdate)
  890. ;
  891.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  892.         _SizeWindow:    OPWORD    $A91D
  893.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  894.         IMPORT_CFM_FUNCTION SizeWindow
  895.     ENDIF
  896.  
  897.  
  898. ;
  899. ; pascal void ZoomWindow(WindowPtr theWindow, short partCode, Boolean front)
  900. ;
  901.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  902.         _ZoomWindow:    OPWORD    $A83A
  903.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  904.         IMPORT_CFM_FUNCTION ZoomWindow
  905.     ENDIF
  906.  
  907. ;
  908. ; pascal long GrowWindow(WindowPtr theWindow, Point startPt, const Rect *bBox)
  909. ;
  910.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  911.         _GrowWindow:    OPWORD    $A92B
  912.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  913.         IMPORT_CFM_FUNCTION GrowWindow
  914.     ENDIF
  915.  
  916. ;
  917. ; pascal void DragWindow(WindowPtr theWindow, Point startPt, const Rect *boundsRect)
  918. ;
  919.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  920.         _DragWindow:    OPWORD    $A925
  921.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  922.         IMPORT_CFM_FUNCTION DragWindow
  923.     ENDIF
  924.  
  925.  
  926. ; ——————————————————————————————————————————————————————————————————————————————————————
  927. ;  • Window Visibility                                                                    
  928. ; ——————————————————————————————————————————————————————————————————————————————————————
  929.  
  930. ;
  931. ; pascal void HideWindow(WindowPtr theWindow)
  932. ;
  933.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  934.         _HideWindow:    OPWORD    $A916
  935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION HideWindow
  937.     ENDIF
  938.  
  939. ;
  940. ; pascal void ShowWindow(WindowPtr theWindow)
  941. ;
  942.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  943.         _ShowWindow:    OPWORD    $A915
  944.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  945.         IMPORT_CFM_FUNCTION ShowWindow
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal void ShowHide(WindowPtr theWindow, Boolean showFlag)
  950. ;
  951.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  952.         _ShowHide:    OPWORD    $A908
  953.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  954.         IMPORT_CFM_FUNCTION ShowHide
  955.     ENDIF
  956.  
  957.  
  958. ; ——————————————————————————————————————————————————————————————————————————————————————
  959. ;  • Utilities                                                                            
  960. ; ——————————————————————————————————————————————————————————————————————————————————————
  961. ;
  962. ; pascal long PinRect(const Rect *theRect, Point thePt)
  963. ;
  964.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  965.         _PinRect:    OPWORD    $A94E
  966.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  967.         IMPORT_CFM_FUNCTION PinRect
  968.     ENDIF
  969.  
  970.  
  971. ;
  972. ; pascal RgnHandle GetGrayRgn(void)
  973. ;
  974.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  975.         Macro
  976.         _GetGrayRgn           &dest=(sp)
  977.             move.l            $09EE,&dest
  978.         EndM
  979.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  980.         IMPORT_CFM_FUNCTION GetGrayRgn
  981.     ENDIF
  982.  
  983.  
  984. ; ——————————————————————————————————————————————————————————————————————————————————————
  985. ;  • Window Part Tracking                                                                
  986. ; ——————————————————————————————————————————————————————————————————————————————————————
  987. ;
  988. ; pascal Boolean TrackBox(WindowPtr theWindow, Point thePt, short partCode)
  989. ;
  990.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  991.         _TrackBox:    OPWORD    $A83B
  992.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  993.         IMPORT_CFM_FUNCTION TrackBox
  994.     ENDIF
  995.  
  996. ;
  997. ; pascal Boolean TrackGoAway(WindowPtr theWindow, Point thePt)
  998. ;
  999.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1000.         _TrackGoAway:    OPWORD    $A91E
  1001.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1002.         IMPORT_CFM_FUNCTION TrackGoAway
  1003.     ENDIF
  1004.  
  1005.  
  1006. ; ——————————————————————————————————————————————————————————————————————————————————————
  1007. ;  • Region Dragging                                                                    
  1008. ; ——————————————————————————————————————————————————————————————————————————————————————
  1009. ;
  1010. ; pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1011. ;
  1012.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1013.         _DragGrayRgn:    OPWORD    $A905
  1014.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1015.         IMPORT_CFM_FUNCTION DragGrayRgn
  1016.     ENDIF
  1017.  
  1018. ;
  1019. ; pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1020. ;
  1021.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1022.         _DragTheRgn:    OPWORD    $A926
  1023.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1024.         IMPORT_CFM_FUNCTION DragTheRgn
  1025.     ENDIF
  1026.  
  1027.  
  1028. ; ——————————————————————————————————————————————————————————————————————————————————————
  1029. ;     • GetAuxWin                                                                            
  1030. ;                                                                                         
  1031. ;     Avoid using GetAuxWin if at all possible                                            
  1032. ; ——————————————————————————————————————————————————————————————————————————————————————
  1033. ;
  1034. ; pascal Boolean GetAuxWin(WindowPtr theWindow, AuxWinHandle *awHndl)
  1035. ;
  1036.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1037.         _GetAuxWin:    OPWORD    $AA42
  1038.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1039.         IMPORT_CFM_FUNCTION GetAuxWin
  1040.     ENDIF
  1041.  
  1042.  
  1043. ; ——————————————————————————————————————————————————————————————————————————————————————
  1044. ;  • MixedMode & ProcPtrs                                                                
  1045. ; ——————————————————————————————————————————————————————————————————————————————————————
  1046. ; ——————————————————————————————————————————————————————————————————————————————————————
  1047. ;  • C Glue                                                                                
  1048. ; ——————————————————————————————————————————————————————————————————————————————————————
  1049. ; ——————————————————————————————————————————————————————————————————————————————————————
  1050. ;  • WindowRecord accessor macros                                                        
  1051. ; ——————————————————————————————————————————————————————————————————————————————————————
  1052. ;    *****************************************************************************
  1053. ;    *                                                                           *
  1054. ;    * The conditional STRICT_WINDOWS has been removed from this interface file. *
  1055. ;    * The accessor macros to a WindowRecord are no longer necessary.            *
  1056. ;    *                                                                           *
  1057. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  1058. ;    *                                                                           *
  1059. ;    *****************************************************************************
  1060. ;
  1061. ;    Details:
  1062. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  1063. ;    help ease the transition to Copland.  Shared data structures are difficult
  1064. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  1065. ;    WindowRecord and other data structures, we would begin the migration to the
  1066. ;    discipline wherein system data structures are completely hidden from
  1067. ;    applications.
  1068. ;    
  1069. ;    After many design reviews, we finally concluded that with this sort of
  1070. ;    migration, the system could never tell when an application was no longer
  1071. ;    peeking at a WindowRecord, and thus the data structure might never become
  1072. ;    system owned.  Additionally, there were many other limitations in the
  1073. ;    classic toolbox that were begging to be addressed.  The final decision was
  1074. ;    to leave the traditional toolbox as a compatibility mode.
  1075. ;    
  1076. ;    We also decided to use the Handle and Ptr based types in the function
  1077. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  1078. ;    WindowRef.  The Ref types are still defined in the header files, so all
  1079. ;    existing code will still compile exactly as it did before.  There are
  1080. ;    several reasons why we chose to do this:
  1081. ;    
  1082. ;    - The importance of backwards compatibility makes it unfeasible for us to
  1083. ;    enforce real opaque references in the implementation anytime in the
  1084. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  1085. ;    ControlRef, etc.) in the documentation and header files would always be a
  1086. ;    fake veneer of opacity.
  1087. ;    
  1088. ;    - There exists a significant base of books and sample code that neophyte
  1089. ;    Macintosh developers use to learn how to program the Macintosh.  These
  1090. ;    books and sample code all use direct data access.  Introducing opaque data
  1091. ;    types at this point would confuse neophyte programmers more than it would
  1092. ;    help them.
  1093. ;    
  1094. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  1095. ;    Changing the interfaces to reflect a false opacity would not provide any
  1096. ;    benefit to these developers.
  1097. ;    
  1098. ;    - Accessor functions are useful in and of themselves as convenience
  1099. ;    functions.
  1100. ;    
  1101. ;    - Note: some accessor names conflict with API's in Win32 and have been renamed
  1102. ;    to have a Mac prefix (QuickTime 3.0).
  1103. ;
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.     ENDIF ; __MACWINDOWS__ 
  1113.  
  1114.